package com.ssh.demo.base.service.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.ssh.demo.base.dao.BaseDao;
import com.ssh.demo.base.service.BaseService;

public class BaseServiceImpl<T, PK extends Serializable> implements BaseService<T, PK> {

	private BaseDao<T, Serializable> baseDao;

	public void saveOrUpdate(T t) {
		baseDao.saveOrUpdate(t);
	}

	public void del(PK pk) {
		baseDao.del(pk);
	}

	public void del(T t) {
		baseDao.del(t);
	}

	public T findById(PK pk) {
		return baseDao.findById(pk);
	}

	public List<T> findAll() {
		return baseDao.findAll();
	}

	public List<T> findByPage(int start, int count) {
		return baseDao.findByPage(start, count);
	}

	// get
	public Session getSession() {
		return baseDao.getSession();
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		// TODO Auto-generated method stub
		
	}

}